﻿
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>在指定的部门里按照岗位计算</title>
    <link href="../../../../DataUser/Style/ccbpm.css" rel="stylesheet" type="text/css" />
    <link href="../../../Scripts/easyUI145/themes/icon.css" rel="stylesheet" type="text/css" />
    <link href="../../../Scripts/easyUI145/themes/default/easyui.css" rel="stylesheet" type="text/css" />
    <script src="../../../Scripts/jquery-1.7.2.min.js" type="text/javascript"></script>
    <script src="../../../Scripts/easyUI/jquery.easyui.min.js" type="text/javascript"></script>
    <script src="../../../Scripts/QueryString.js" type="text/javascript"></script>
    <script type="text/javascript" src="../../../Scripts/config.js"></script>
    <script type="text/javascript" src="../../../Comm/Gener.js"></script>
    <script src="DDLBar.js" type="text/javascript"></script>
    <script src="../../CCFlowEnum.js" type="text/javascript"></script>
    <script src="../../../Scripts/EasyUIUtility.js" type="text/javascript"></script>
    <script src="../../../Scripts/vue.js" type="text/javascript"></script>
    <!-- 自己的系统风格统一. -->
    <link href="../../../Style/skin/adminfont/iconfont.css" rel="stylesheet" />
    <link href="../../../Style/skin/css/Default.css" rel="stylesheet" />
    <!-- 自己的系统风格统一end -->
</head>
<body>
    <div id="App">
        <div id="bar"> </div>

        <fieldset>
            <legend>绑定岗位</legend>
            <ul>
                <li><a href="javascript:OpenDot2DotStations()">绑定岗位-分组模式</a> </li>
                <li><a href="javascript:OpenBranchesAndLeafStations()">绑定岗位-左右树结构模式</a> </li>
            </ul>
        </fieldset>


        <div class="cs-content-box">
            <div style="background-color:#ffffff;  box-shadow: 0 0 10px rgba(0,0,0,.1); border-radius: 3px; padding: 0 28px 12px;margin: -6px 0 10px; border: 0;font-size: 13px;">
                <table style="width:60%;">
                    <caption>已经设置的岗位,合计:(<font color=red>{{stas.length}}</font>)条</caption>
                    <tr v-show="index ==0 ||(index+1)%8 == 0" v-for="(m,index) in stas">
                        <template v-for="(sta,i) in stas" v-if="i>=index&& i<index+7">
                            <td>{{sta.FK_StationText}}</td>
                        </template>
                    </tr>
                </table>
            </div>
        </div>

        <div class="cs-content-box">
            <div style="background-color:#ffffff;  box-shadow: 0 0 10px rgba(0,0,0,.1); border-radius: 3px; padding: 0 28px 12px;margin: -6px 0 10px; border: 0;font-size: 13px;">

                <fieldset id="help">
                    <legend >帮助 </legend>
                    <ul>
                        <li>说明：绑定的所有的人员，都可以处理该节点的工作。</li>
                        <li> 绑定多少个人，当前节点就有多少个人处理，这一种是最简洁最直接的方式。</li>
                        <li> 适用于当前节点人员比较稳定，一般不会变化的情况。</li>
                        <li> 如果人员变化比较频繁，就需要设置岗位，让岗位设置人员。</li>
                    </ul>
                </fieldset>
            </div>
        </div>


        <script type="text/javascript">
            var Baseinfo = new Vue({
                el: '#App',
                data: {
                    adminModel: 1,
                    orgModel: 0,
                    stas: [],
                    webuser: null,
                    deliverWay: DeliveryWay.FindSpecDeptEmpsInStationlist
                },
                methods: {
                    OpenDot2DotStations: function () {
                        OpenDot2DotStations();
                    },
                    OpenNew: function () {
                        var nodeID = GetQueryString("FK_Node");
                        var url = "../../../Comm/RefFunc/BranchesAndLeaf.htm?EnName=BP.WF.Template.NodeSheet&Dot2DotEnsName=BP.WF.Template.NodeStations&Dot2DotEnName=BP.WF.Template.NodeStation&AttrOfOneInMM=FK_Node&AttrOfMInMM=FK_Station&EnsOfM=BP.Port.Stations&DefaultGroupAttrKey=FK_StationType&NodeID=" + nodeID + "&PKVal=" + nodeID;
                        OpenEasyUiDialogExtCloseFunc(url, '设置岗位', 800, 500, function () {
                            Baseinfo.stas = getStas();
                        });
                    },
                    SetGroupStations: function () {
                        OpenNodStationGroup(this.webuser.GroupNo);

                    },
                    SetOrgStations: function () {
                        OpenNodStationGroup(this.webuser.FK_Dept);
                    }
                },
                created() {
                    InitBar(this.deliverWay);
                    this.stas = getStas();

                    //根据用户的信息，判断是否启用那个设置工具。
                    this.webuser = new WebUser();
                    this.adminModel = this.webuser.No == "admin" ? 1 : 0;
                    this.orgModel = this.webuser.No == "admin" ? 0 : 1;
                }
            });

            function OpenNodStationGroup(orgNo) {
                var url = "NodeStationGroup.htm?OrgNo=" + orgNo + "&FK_Node=" + GetQueryString("FK_Node");
                OpenEasyUiDialogExtCloseFunc(url, '绑定岗位', 500, 600, function () {
                    Baseinfo.stas = getStas();
                });
            }

            //保存
            function Save() {
                var nodeID = GetQueryString("FK_Node");
                var node = new Entity("BP.WF.Node", nodeID);
                node.DeliveryWay = Baseinfo.deliverWay;
                node.Update();
            }
        </script>

    </div></body>
</html>
